package com.lxx.onlineview.mapper;

import com.lxx.onlineview.entity.po.News;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.UpdateProvider;

import java.util.List;
@Mapper
public interface NewsMapper {

    @InsertProvider(value = NewsProvider.class,method = "insert")
    int insert(News record);

    @Select("select * from news where teacher = #{teacher} and course = #{course}")
    List<News> selectByTeacherAndCourse(String teacher,String course);

    @Select("select * from news")
    List<News> selectAll();

    @UpdateProvider(value = NewsProvider.class,method = "update")
    int updateByPrimaryKey(News record);
}
